export function dateToString(date: Date): string {
    let day: number | string = date.getDate();
    let month: number | string = date.getMonth() + 1;
    let year: number = date.getFullYear();
    let hours: number | string = date.getHours();
    let minutes: number | string = date.getMinutes();
    let seconds: number | string = date.getSeconds();

    // 添加零来保持两位数格式
    day = day < 10 ? `0${day}` : day;
    month = month < 10 ? `0${month}` : month;
    hours = hours < 10 ? `0${hours}` : hours;
    minutes = minutes < 10 ? `0${minutes}` : minutes;
    seconds = seconds < 10 ? `0${seconds}` : seconds;

    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}

export function isBetween(value: number, min: number, max: number) {
    return value >= min && value <= max;
}

export function getLastTwoDigitsAfterDivision(value: number): string {
    return (value / 100000).toFixed(2);
}
export function getEcpm(value: number): string {
    return (value / 100).toFixed(2);
}
